using Microsoft.AspNetCore.Mvc;

var builder = WebApplication.CreateBuilder(args);

var app = builder.Build();

app.MapGet("/CheckUpdate", ([FromQuery] string ver, HttpContext ctx) =>
{
    var logPath = Path.Combine(app.Environment.ContentRootPath, "log.txt");
    File.AppendAllText(logPath, $"{DateTime.Now}\t{ctx.Connection.RemoteIpAddress}\tCheckUpdate\t{ver}");
    return new { ver = "0.1", url = "http://dbbox.cc/file/0.1.zip", size = 1024, md5 = "abcdefghijk" };
});

app.UseStaticFiles();
app.Run();
